home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
INFO
/
XFDISK.ZIP
/
CP3204.DOC
< prev
next >
Wrap
Text File
|
1991-08-28
|
71KB
|
1,479 lines
@echo off
echo
echo CP3204 version 1.00 August 28, 1991
echo Fixed Disk Preparation and Partitioning Software.
echo Copyright (C) 1991 Dennis W. Person. All rights reserved.
echo
echo ┌────────────────────────────────────────────────────────────────────────────┐
echo │ This DOC file is also the program BAT file. │
echo │ You should print this DOC file before you try to run the program. │
echo │ │
echo │ !!!!!!!!!! THIS PROGRAM CAN DESTROY DATA ON YOUR FIXED DISK. !!!!!!!!!! │
echo │ │
echo │ Read and understand the information contained in this DOC file before │
echo │ you attempt to use this program to partition your fixed disk. │
echo └────────────────────────────────────────────────────────────────────────────┘
echo
echo Press CTRL-C to terminate this program or . . .
pause
if [%4]==[] goto GETFILE
if [%4]==[rem] goto GETFILE
if [%4]==[REM] goto GETFILE
goto HELP
:GETFILE
set OUTFILE=NUL
if [%3]==[] goto OPTIONS
if [%3]==[NUL] goto OPTIONS
set OUTFILE=%3.LST
:OPTIONS
set OPTION=PREPARE
if [%2]==[p] goto GETDRIV
if [%2]==[P] goto GETDRIV
set OPTION=RESTORE
if [%2]==[r] goto GETDRIV
if [%2]==[R] goto GETDRIV
goto HELP
:GETDRIV
if [%1]==[/1] goto CONTINUE
if [%1]==[/2] goto CONTINUE
goto HELP
:CONTINUE
echo BEGIN - creation of CP3204.SCR
rem Check for existence of DEBUG script file.
if [%1]==[/1] if exist CP3204.1%2%4 ren CP3204.1%2%4 CP3204.SCR
if [%1]==[/2] if exist CP3204.2%2%4 ren CP3204.2%2%4 CP3204.SCR
rem Use existing DEBUG script file to partition drive to save processing time.
if exist CP3204.SCR goto RUN
goto BEGIN
rem
:HELP
cls
echo This program will partition the Conner Peripherals CP-3204 IDE fixed disk.
echo The CP-3204 physically has 1369 cylinders, 8 heads, and 38 sectors per track.
echo Since the number of cylinders is greater than the 1024 allowed by DOS, the
echo logical setup used is 544 cylinders, 15 heads, and 51 sectors per track.
echo The CP-3204 does the logical to physical translation. The logical setup is
echo user defined and entered by the user using a BIOS that allows for a user
echo defined fixed disk type. In my case, I patched the BIOS ROM to allow for the
echo user type I had chosen.
echo
echo Be aware that DOS uses 1 less cylinder than specified in the fixed disk
echo parameter table. This is because the last cylinder is considered the
echo diagnostic cylinder. If you wish to use the diagnostic cylinder for data,
echo increase the number of cylinders specified during the setup by 1. Only do
echo this if you do not want the diagnostic cylinder available. In my case,
echo I entered 545 as the number of cylinders during the setup. This allows
echo me to use all 544 cylinders for data.
echo
echo One additional note, the astute reader will have discovered that the
echo physical parameters give 416,176 sectors available on the CP-3204. The
echo chosen logical parameters give 416,160 sectors available. The chosen
echo parameters give the closest match to using all the available sectors.
echo
echo Now, to see the command syntax to run this program . . .
pause
cls
echo
echo Command: CP3204 [/1│/2] [R│P] [list_file│NUL] [REM]
echo
echo /1 Select 1st fixed disk.
echo /2 Select 2nd fixed disk.
echo R Restore fixed disk partitions.
echo P Prepare and partition fixed disk.
echo list_file Filename.LST to capture DEBUG output if desired.
echo Do NOT enter the default .LST extension.
echo NUL Use NUL as the filename if no output file is desired but,
echo the REM option is desired.
echo REM Remarks only {will still create DEBUG script file}.
echo Useful to check script file before actual disk partitioning.
echo
echo Options must be entered in the order shown and separated by a space.
goto EXIT
rem
:BEGIN
rem Partition Program Code
rem ──────────────────────
rem The program code to write the partition sector, boot sector, and first FAT
rem sector to fixed disk partition. This code will be executed for each
rem logical drive on the fixed disk. The DEBUG script that follows will setup
rem the partition sector and boot sector data for each logical drive. The DEBUG
rem script will then control execution of the program code.
rem Clear program work area.
echo F 0100 07FF 0 > CP3204.SCR
echo A 100 >> CP3204.SCR
echo MOV AX,CS ; get CS register >> CP3204.SCR
echo MOV DS,AX ; initialize DS register >> CP3204.SCR
echo MOV ES,AX ; initialize DS register >> CP3204.SCR
echo ; >> CP3204.SCR
echo MOV AH,30 ; get function code to check DOS version >> CP3204.SCR
echo INT 21 ; call DOS routine to get version number >> CP3204.SCR
echo CMP AL,5 ; check for DOS version 5.00 or higher >> CP3204.SCR
echo JGE 112 ; JGE CONTINUE to partition fixed disk >> CP3204.SCR
echo ; otherwise, incorrect DOS version >> CP3204.SCR
echo MOV AL,80 ; set ERRORLEVEL value to indicate incorrect DOS version >> CP3204.SCR
echo JMP 130 ; JMP ERROR >> CP3204.SCR
echo ; >> CP3204.SCR
echo ;[CONTINUE] >> CP3204.SCR
echo MOV SI,0003 ; initalize loop counter >> CP3204.SCR
echo ; >> CP3204.SCR
echo ;[LOOP] >> CP3204.SCR
echo MOV AH,03 ; get function code to write to disk >> CP3204.SCR
rem If [P] option chosen, write the partition, boot, and 1st FAT sectors.
if [%2]==[P] echo MOV AL,03 ; get number of sectors to write >> CP3204.SCR
if [%2]==[p] echo MOV AL,03 ; get number of sectors to write >> CP3204.SCR
rem If [R] option chosen, only write the partition and boot sectors
if [%2]==[R] echo MOV AL,02 ; get number of sectors to write >> CP3204.SCR
if [%2]==[r] echo MOV AL,02 ; get number of sectors to write >> CP3204.SCR
echo MOV BX,0200 ; ES:BX points to beginning of data >> CP3204.SCR
echo MOV CX,0001 ; set CH to low order byte for cylinder number >> CP3204.SCR
echo ; set CL lower 6-bits to sector number >> CP3204.SCR
echo ; set CL upper 2-bits to high order bits for cylinder number >> CP3204.SCR
echo MOV DH,00 ; get number for head (side) >> CP3204.SCR
if [%1]==[/1] echo MOV DL,80 ; get drive number for 1st fixed disk >> CP3204.SCR
if [%1]==[/2] echo MOV DL,81 ; get drive number for 2nd fixed disk >> CP3204.SCR
echo INT 13 ; call BIOS routine which provides disk services >> CP3204.SCR
echo JNC 0134 ; JNC WRITEOK if no error >> CP3204.SCR
echo ; otherwise, . . . >> CP3204.SCR
echo MOV AH,0 ; get function code to reset disk system >> CP3204.SCR
echo INT 13 ; call BIOS routine which provides disk services >> CP3204.SCR
echo DEC SI ; decrement loop counter >> CP3204.SCR
echo JNZ 0115 ; JNZ LOOP to try to write to disk again >> CP3204.SCR
echo ; otherwise, . . . >> CP3204.SCR
echo MOV AL,02 ; set ERRORLEVEL value to indicate error >> CP3204.SCR
echo ; ; and . . . >> CP3204.SCR
echo ;[ERROR] terminate program with ERRORLEVEL value >> CP3204.SCR
echo MOV AH,4C ; get function code to teminate program >> CP3204.SCR
echo INT 21 ; and exit program >> CP3204.SCR
echo ; >> CP3204.SCR
echo ;[WRITEOK] >> CP3204.SCR
echo MOV AL,00 ; set ERRORLEVEL value to indicate success >> CP3204.SCR
echo MOV AH,4C ; get function code to teminate program >> CP3204.SCR
echo INT 21 ; and exit program >> CP3204.SCR
echo NOP >> CP3204.SCR
echo >> CP3204.SCR
rem Use CTRL-H (BACKSPACE) character for ^H shown on the line above.
echo creation of Partition Program complete . . .
rem If 2nd fixed disk option chosen, do NOT put Partiton Boot Program on disk.
if [%1]==[/2] goto PUTABLE
rem
rem Partition Boot Program
rem ──────────────────────
rem This is the partition boot program for the 1st fixed disk. The program
rem must be physically located on the 1st sector of the fixed disk, i.e.,
rem cylinder 0, head 0, sector 1.
echo A 200 >> CP3204.SCR
echo CLI >> CP3204.SCR
echo XOR AX,AX >> CP3204.SCR
echo MOV DS,AX >> CP3204.SCR
echo MOV ES,AX >> CP3204.SCR
echo MOV SS,AX >> CP3204.SCR
echo MOV SP,7C00 >> CP3204.SCR
echo MOV SI,SP >> CP3204.SCR
echo STI >> CP3204.SCR
echo CLD >> CP3204.SCR
echo MOV DI,600 >> CP3204.SCR
echo MOV CX,100 >> CP3204.SCR
echo REPNZ >> CP3204.SCR
echo MOVSW >> CP3204.SCR
echo JMP 0:61D >> CP3204.SCR
echo MOV SI,7BE >> CP3204.SCR
echo MOV BL,4 >> CP3204.SCR
echo CMP BYTE PTR [SI],80 >> CP3204.SCR
echo JZ 235 >> CP3204.SCR
echo CMP BYTE PTR [SI],0 >> CP3204.SCR
echo JNZ 248 >> CP3204.SCR
echo ADD SI,+10 >> CP3204.SCR
echo DEC BL >> CP3204.SCR
echo JNZ 222 >> CP3204.SCR
echo INT 18 >> CP3204.SCR
echo MOV DX,[SI] >> CP3204.SCR
echo MOV CX,[SI+2] >> CP3204.SCR
echo MOV BP,SI >> CP3204.SCR
echo ADD SI,+10 >> CP3204.SCR
echo DEC BL >> CP3204.SCR
echo JZ 25D >> CP3204.SCR
echo CMP BYTE PTR [SI],0 >> CP3204.SCR
echo JZ 23C >> CP3204.SCR
echo MOV SI,68B >> CP3204.SCR
echo LODSB >> CP3204.SCR
echo CMP AL,0 >> CP3204.SCR
echo JZ 25B >> CP3204.SCR
echo PUSH SI >> CP3204.SCR
echo MOV BX,7 >> CP3204.SCR
echo MOV AH,E >> CP3204.SCR
echo INT 10 >> CP3204.SCR
echo POP SI >> CP3204.SCR
echo JMP 24B >> CP3204.SCR
echo JMP 25B >> CP3204.SCR
echo MOV DI,3 >> CP3204.SCR
echo PUSH DI >> CP3204.SCR
echo MOV BX,7C00 >> CP3204.SCR
echo MOV AX,201 >> CP3204.SCR
echo INT 13 >> CP3204.SCR
echo POP DI >> CP3204.SCR
echo JNC 278 >> CP3204.SCR
echo XOR AX,AX >> CP3204.SCR
echo INT 13 >> CP3204.SCR
echo DEC DI >> CP3204.SCR
echo JNZ 260 >> CP3204.SCR
echo MOV SI,6A5 >> CP3204.SCR
echo JMP 24B >> CP3204.SCR
echo MOV SI,6C6 >> CP3204.SCR
echo MOV DI,7DFE >> CP3204.SCR
echo CMP WORD PTR [DI],AA55 >> CP3204.SCR
echo JNZ 24B >> CP3204.SCR
echo MOV SI,BP >> CP3204.SCR
echo JMP 0:7C00 >> CP3204.SCR
echo >> CP3204.SCR
rem Use CTRL-H (BACKSPACE) character for ^H shown on the line above.
echo E 28B D A "Invalid Partition Table" 0 >> CP3204.SCR
echo E 2A5 D A "Error Loading Operating System" 0 >> CP3204.SCR
echo E 2C6 D A "Missing Operating System" 0 >> CP3204.SCR
rem
:PUTABLE
rem The master partition table also resides on the 1st sector following the
rem master boot program. The following line is to initialize the partition
rem table. See below for information on the partition table.
echo F 2E1 3FD 0 >> CP3204.SCR
rem The two bytes below MUST be as shown in order for the BIOS the recognize
rem the fixed disk. The bytes represent that the partition sector is valid.
rem Write signature to indicate valid partition sector.
echo E 3FE 55 AA >> CP3204.SCR
echo creation of partition sector complete . . .
rem F I X E D D I S K D R I V E P A R T I T I O N T A B L E
rem ═══════════════════════════════════════════════════════════════════════════════
rem ┌──────┬────┬────────────────────┬────────────────────┬───────────┬───────────┐
rem │ │ │ Starting Location │ Ending Location │ Relative │ Number of │
rem │System│Boot│Side Cylinder Sector│Side Cylinder Sector│ Sectors │ Sectors │
rem ├──────┼────┼────────────────────┼────────────────────┼───────────┼───────────┤
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem └──────┴────┴────────────────────┴────────────────────┴───────────┴───────────┘
rem NOTE: The partition table allows a maximum of four (4) partitions.
rem See the following pages for sector offset to each item in the table.
rem Only one partition can be marked as the boot partition with the code
rem 80 hex. The other partitions MUST contain 0 as the boot byte.
rem Invalid codes will produce the "Invalid Partition Table" message and
rem prevent your system from booting.
rem For a fixed disk with a PRIMARY partition, FDISK will reserve the entire first
rem track. Programs such as Ontrack's Disk Manager use those reserved sectors to
rem store their own disk information. So, if you are using one of those programs,
rem do NOT use this program.
rem For a fixed disk with only an EXTENDed partition, FDISK will reserve the entire
rem first cylinder of the disk for the Master Partition Table. Each logical drive
rem in an EXTENDed partition also requires a partition table. So, FDISK will also
rem reserve the first track of each logical drive for the partition table.
rem Since the partition table only requires 1 sector, DOS is wasting your hard disk
rem space. The information on the following pages will allow you to reclaim the
rem disk space that DOS does not use. Remember, the procedure can only be used
rem if your fixed disk does NOT require a program such as Ontrack's Disk Manager.
rem Additional information regarding systems with 2 fixed disks is shown on the
rem following page. The information will allow you to decide whether to partition
rem the 2nd fixed disk with a PRIMARY partition and an EXTENDEDed partition OR with
rem only an EXTENDEDed partition. I chose to partition the 2nd fixed disk with only
rem an EXTENDEDed partition.
rem
rem Shown below are the drive letters assigned by DOS to the logical drives on each
rem fixed disk. Note that the PRIMARY partitions have priority in drive letter
rem assignments. The PRIMARY partition on the 1st fixed disk is always drive C:.
rem The PRIMARY partition on the 2nd fixed disk is always drive D:. Additional
rem logical drives are then assigned to the 1st fixed disk, then to the 2nd fixed
rem disk.
rem PRIMARY and EXTENDed partition on 1st fixed disk
rem ────────────────────────────────────────────────
rem PRIMARY partition ── C:
rem EXTENDed partition ── D: E: F: , etc.
rem Extended partition on 2nd fixed disk
rem ────────────────────────────────────
rem EXTENDed partition ── G: H: I: J: , etc.
rem PRIMARY and EXTENDed partition on 1st fixed disk
rem ────────────────────────────────────────────────
rem PRIMARY partition ── C:
rem EXTENDed partition ── E: F: G: , etc.
rem PRIMARY and EXTENDed partition on 2nd fixed disk
rem ────────────────────────────────────────────────
rem PRIMARY partition ── D:
rem EXTENDed partition ── H: I: J: , etc.
rem
rem Shown below is the location of each byte in the partition table. A maximum
rem of four partitions may be defined.
rem sector
rem offset Parameters for 1st Partition:
rem ────── ─────────────────────────────
rem 01BE 00 ; partition status (active [80] or non-active [00])
rem 01BF 00 ; starting side
rem 01C0 00 ; starting sector (lower 6-bits, upper 2-bits for cylinder)
rem 01C1 00 ; starting cylinder (lower byte)
rem 01C2 00 ; system (valid codes listed later in document)
rem 01C3 00 ; ending side
rem 01C4 00 ; ending sector (lower 6-bits, upper 2-bits for cylinder)
rem 01C5 00 ; ending cylinder (lower byte)
rem 01C6 00 00 00 00 ; relative sectors
rem 01CA 00 00 00 00 ; number of sectors
rem sector
rem offset Parameters for 2nd Partition:
rem ────── ─────────────────────────────
rem 01CE 00 ; partition status (active [80] or non-active [00])
rem 01CF 00 ; starting side
rem 01D0 00 ; starting sector (lower 6-bits, upper 2-bits for cylinder)
rem 01D1 00 ; starting cylinder (lower byte)
rem 01D2 00 ; system (valid codes listed later in document)
rem 01D3 00 ; ending side
rem 01D4 00 ; ending sector (lower 6-bits, upper 2-bits for cylinder)
rem 01D5 00 ; ending cylinder (lower byte)
rem 01D6 00 00 00 00 ; relative sectors
rem 01DA 00 00 00 00 ; number of sectors
rem sector
rem offset Parameters for 3rd Partition:
rem ────── ─────────────────────────────
rem 01DE 00 ; partition status (active [80] or non-active [00])
rem 01DF 00 ; starting side
rem 01E0 00 ; starting sector (lower 6-bits, upper 2-bits for cylinder)
rem 01E1 00 ; starting cylinder (lower byte)
rem 01E2 00 ; system (valid codes listed later in document)
rem 01E3 00 ; ending side
rem 01E4 00 ; ending sector (lower 6-bits, upper 2-bits for cylinder)
rem 01E5 00 ; ending cylinder (lower byte)
rem 01E6 00 00 00 00 ; relative sectors
rem 01EA 00 00 00 00 ; number of sectors
rem sector
rem offset Parameters for 4th Partition:
rem ────── ─────────────────────────────
rem 01EE 00 ; partition status (active [80] or non-active [00])
rem 01EF 00 ; starting side
rem 01F0 00 ; starting sector (lower 6-bits, upper 2-bits for cylinder)
rem 01F1 00 ; starting cylinder (lower byte)
rem 01F2 00 ; system (valid codes listed later in document)
rem 01F3 00 ; ending side
rem 01F4 00 ; ending sector (lower 6-bits, upper 2-bits for cylinder)
rem 01F5 00 ; ending cylinder (lower byte)
rem 01F6 00 00 00 00 ; relative sectors
rem 01FA 00 00 00 00 ; number of sectors
rem See the following page for an explanation of each item in the partition
rem table.
rem DOS numbers sides (heads) and cylinders starting with 0. Sectors are
rem numbered starting with 1.
rem Note: The upper 2-bits of the cylinder number is contained in the upper
rem 2-bits of the byte for the sector number. This means the maximum
rem sector number is 63 and the maximum cylinder number is 1023.
rem Remember this when you are ready to prepare the partition tables
rem for your fixed disk. Study the partition tables shown later in
rem this document.
rem
rem The PARTITION STATUS byte is actually the drive number select byte.
rem Since the 1st hard disk is assigned the drive number 80, the partition
rem with the status byte equal to 80 will be the boot partition. Only one
rem partition can be the active (boot) partition. By changing the PARTITION
rem STATUS byte and the partition boot program active partition byte to 81,
rem you could boot from the 2nd fixed disk instead of the 1st fixed disk.
rem For a DOS partition, the STARTING parameters define the physical location
rem of the logical drive boot sector. For an EXTENDed partition, the STARTING
rem parameters define the physical location of the beginning of the EXTENDed
rem partition. This will correspond to the physical location of the partition
rem table for the first logical drive in the EXTENDed partition.
rem The SYSTEM byte indicates the type of partition. Valid SYSTEM bytes are
rem listed on the page before the partition table definition for drive C: shown
rem later in this DOC file.
rem The ENDING parameters define the physical location of the end of the
rem partition for both a DOS partition and an EXTENDed partition.
rem For a DOS partition, RELATIVE SECTORS is the number of physical sectors
rem in the partition before the logical drive boot sector. This number will
rem correspond to the number of hidden sectors in the BIOS Parameter Table.
rem For the fixed disk EXTENDed partition, RELATIVE SECTORS is the number of
rem physical sectors in the DOS partition. This corresponds to the number of
rem physical sectors before the beginning of the EXTENDed partition. For an
rem EXTENDed partition for a logical drive, RELATIVE SECTORS is the number of
rem physical sectors in the fixed disk EXTENDed partition that are before the
rem partition sector for the logical drive.
rem For a DOS partition, NUMBER OF SECTORS is the number of sectors allocated
rem to the logical drive. For the fixed disk EXTENDed partition, NUMBER OF
rem SECTORS is the number of sectors allocated to the EXTENDed partition. For
rem an EXTENDed partition for a logical drive, NUMBER OF SECTORS is the number
rem of sectors allocated to the next logical drive.
rem The partition table for each logical drive I have setup on my fixed disks
rem is shown later in this DOC file. Study and understand the partition tables
rem before you try to setup the partition tables for your fixed disk. The
rem partition tables are what allow the fixed disk to be divided into logical
rem drives. Be careful as you setup the partition tables on your fixed disk.
rem A few additional items and caveats. You MUST use DOS version 5 or higher
rem in order for the partition structure described in this document to be
rem recognized by DOS. Also, FDISK does not recognize the partition structure
rem I have setup on my fixed disks. But, since the partition structure is
rem known, FDISK is NOT really needed. In fact, the system will hang if I try
rem to run FDISK.
rem
:BOOT
rem D O S B O O T S E C T O R
rem ═══════════════════════════════════════════════════════════════════════════════
rem The JMP instruction is to end of BIOS Parameter Block. Space is prvided for
rem a 3-byte JMP instruction. DOS reads this instruction to determine the length
rem of the BIOS Parameter Block. So, this instruction CANNOT be eliminated from
rem the logical drives in EXTENDed partitions.
echo A 400 >> CP3204.SCR
echo JMP 43E >> CP3204.SCR
echo NOP >> CP3204.SCR
echo >> CP3204.SCR
rem Use CTRL-H (BACKSPACE) character for ^H shown on the line above.
rem sector
rem offset B I O S P A R A M E T E R B L O C K D A T A
rem ═══════════════════════════════════════════════════════════════════════════════
rem 0003 OEM ID: 8-characters
rem 000B Bytes per sector: 0..65,535 (2-bytes)
rem 000D Sectors per cluster: 0..255 (1-byte)
rem 000E Reserved sectors at beginning: 0..65,535 (2-bytes)
rem 0010 FAT Copies: 0..255 (1-byte)
rem 0011 Root directory entries: 0..65,535 (2-bytes)
rem 0013 Total sectors on disk: 0..65,535 (2-bytes)
rem 0015 Media descriptor byte: 1-byte (see table below)
rem 0016 Sectors per FAT: 0..65,535 (2-bytes)
rem 0018 Sectors per track: 0..65,535 (2-bytes)
rem 001A Sides: 0..65,535 (2-bytes)
rem 001C Special hidden sectors: 0..4,294,967,295 (4-bytes)
rem Extended BIOS Parameter Block supported by DOS 4 and DOS 5. This is where
rem DOS 'breaks' the 32Mb disk barrier but leaves the 64K cluster barrier.
rem ═══════════════════════════════════════════════════════════════════════════════
rem 0020 Big total number of sectors: 0.. (4-bytes)
rem 0024 Physical drive number: 0..255 (1-byte)
rem 0025 unknown: 0..255 (1-byte)
rem 0026 Extended Boot Record Signature: 29 hex (1-byte)
rem 0027 Volume Serial Number: 4-byte time & date code
rem 002B Volume Label: 11-characters
rem 0036 File System ID: 8-characters (usually FAT12 or FAT16)
rem V A L I D M E D I A D E S C R I P T O R B Y T E S
rem ═══════════════════════════════════════════════════════════════════════════════
rem F8 ── Fixed Disk or RAM disk
rem ?? ── 3½ inch, 2 sides, 80 tracks, 36 sectors per track ── 2.88M
rem F0 ── 3½ inch, 2 sides, 80 tracks, 18 sectors per track ── 1.44M
rem F9 ── 3½ inch, 2 sides, 80 tracks, 9 sectors per track ── 720K
rem F9 ── 5¼ inch, 2 sides, 80 tracks, 15 sectors per track ── 1.2M
rem FC ── 5¼ inch, 1 side, 40 tracks, 9 sectors per track ── 180K
rem FD ── 5¼ inch, 2 sides, 40 tracks, 9 sectors per track ── 360K
rem FE ── 5¼ inch, 1 side, 40 tracks, 8 sectors per track ── 160K
rem FF ── 5¼ inch, 2 sides, 40 tracks, 8 sectors per track ── 320K
rem Values above are hex codes.
rem NOTE: The descriptor byte F9 is used for both the 5¼ inch 1.2Mb floppy
rem and the 3½ inch 720Kb floppy. (I don't know why DOS does that.)
rem The descriptor byte for the 2.88Mb floppy supported by DOS 5.00
rem is not known.
rem
rem The specific BIOS Parameter Block for the chosen logical disk size is
rem shown below. Note the cluster (allocation unit) size of 1K, 2 sectors per
rem cluster. Although this increases the FAT size, the data area lost for
rem files will be made up by reduced waste at the end of files.
rem The number of clusters on the disk cannot exceed 65,534. This is because
rem the cluster number is represented by 16-bits. Since the first four bytes
rem of the FAT are reserved for the media description, the first cluster
rem available is cluster 2. So, DOS will adjust the number of sectors per
rem cluster to 2, 4, 8, etc. to keep to number of clusters less than 65,534.
rem Use the following formulas to determine the the number of FAT sectors
rem required for each FAT. DOS requires that 2 FAT's exist on all fixed disks.
rem You cannot eliminate a FAT to gain data space.
rem total_data_sectors 2 bytes_per_cluster (FAT16)
rem sectors_per_FAT = ─────────────────── X ────────────────────
rem sectors_per_cluster 512 bytes_per_sector
rem total_data_sectors = total_disk_sectors - reserved_sectors - root_directory_sectors
rem - 2 X sectors_per_FAT
rem 32 bytes_per_entry
rem root_directory_sectors = root_directory_entries X ────────────────────
rem 512 bytes_per_sector
rem sector
rem offset B I O S P A R A M E T E R B L O C K D A T A
rem ═══════════════════════════════════════════════════════════════════════════════
rem 0003 OEM ID: DWPerson
rem 000B Bytes per sector: 512 ; all DOS disks use 512
rem 000D Sectors per cluster: 2 ; 1K cluster size
rem 000E Reserved sectors at beginning: 1 ; number of boot sectors
rem 0010 FAT Copies: 2 ; must be 2
rem 0011 Root directory entries: 512 ; default value
rem 0013 Total sectors on disk: 0 ; 0 indicates BIGDOS
rem 0015 Media descriptor byte: F8 hex ; indicates fixed disk
rem 0016 Sectors per FAT: 203 ; use formulas shown above
rem 0018 Sectors per track: 51 ; fixed disk parameter
rem 001A Sides: 15 ; fixed disk parameter
rem 001C Special hidden sectors: 1 ; partition sector
rem 0020 Big total number of sectors: 104039 ; logical disk size
rem 0024 Physical drive number: 128 ; 1st fixed disk number
rem 0025 unknown: 0 ; reserved parameter byte
rem 0026 Extended Boot Record Signature: 29 hex ; significance unknown
rem 0027 Volume Serial Number: 1991-0831 hex ; choosen serial number
rem 002B Volume Label: FDISK1 VOL1 ; same as in directory
rem 0036 File System ID: FAT16 ; use 2 bytes in FAT
rem The actual BIOS Parameter Block data.
rem Remember, data order is low-byte, then high-byte.
echo E 403 "DWPerson" >> CP3204.SCR
echo E 40B 00 02 >> CP3204.SCR
echo E 40D 02 >> CP3204.SCR
echo E 40E 01 00 >> CP3204.SCR
echo E 410 02 >> CP3204.SCR
echo E 411 00 02 >> CP3204.SCR
echo E 413 00 00 >> CP3204.SCR
echo E 415 F8 >> CP3204.SCR
echo E 416 CB 00 >> CP3204.SCR
echo E 418 33 00 >> CP3204.SCR
echo E 41A 0F 00 >> CP3204.SCR
echo E 41C 01 00 00 00 >> CP3204.SCR
echo E 420 67 96 01 00 >> CP3204.SCR
if [%1]==[/1] echo E 424 80 >> CP3204.SCR
if [%1]==[/2] echo E 424 81 >> CP3204.SCR
echo E 425 00 >> CP3204.SCR
echo E 426 29 >> CP3204.SCR
echo E 427 31 08 91 19 >> CP3204.SCR
echo E 42B "FDISK" >> CP3204.SCR
if [%1]==[/1] echo E 430 "1" >> CP3204.SCR
if [%1]==[/2] echo E 430 "2" >> CP3204.SCR
echo E 431 " VOL" >> CP3204.SCR
echo E 435 "?" >> CP3204.SCR
echo E 436 "FAT16 " >> CP3204.SCR
rem
if [%1]==[/2] goto PUTSIGN
rem DOS Boot Program
rem ────────────────
rem This is the DOS boot program which resides as the first logical sector of
rem of the boot disk. The boot sector includes the BIOS Parameter Block (BPB)
rem at the beginning of the boot sector. At boot, DOS reads the BPB of each
rem logical disk to determine the logical parameters of the disk.
echo A 43E >> CP3204.SCR
echo CLI >> CP3204.SCR
echo XOR AX,AX >> CP3204.SCR
echo MOV ES,AX >> CP3204.SCR
echo MOV SS,AX >> CP3204.SCR
echo MOV SP,7C00 >> CP3204.SCR
echo MOV BX,78 >> CP3204.SCR
echo SS: LDS SI,[BX] >> CP3204.SCR
echo PUSH DS >> CP3204.SCR
echo PUSH SI >> CP3204.SCR
echo PUSH SS >> CP3204.SCR
echo PUSH BX >> CP3204.SCR
echo MOV DI,7C3E >> CP3204.SCR
echo MOV CX,B >> CP3204.SCR
echo CLD >> CP3204.SCR
echo REPZ >> CP3204.SCR
echo MOVSB >> CP3204.SCR
echo PUSH ES >> CP3204.SCR
echo POP DS >> CP3204.SCR
echo MOV BYTE PTR [DI-2],F >> CP3204.SCR
echo MOV CX,[7C18] >> CP3204.SCR
echo MOV [DI-7],CL >> CP3204.SCR
echo MOV [BX+2],AX >> CP3204.SCR
echo MOV WORD PTR [BX],7C3E >> CP3204.SCR
echo STI >> CP3204.SCR
echo INT 13 >> CP3204.SCR
echo JC 4ED >> CP3204.SCR
echo XOR AX,AX >> CP3204.SCR
echo CMP [7C13],AX >> CP3204.SCR
echo JZ 484 >> CP3204.SCR
echo MOV CX,[7C13] >> CP3204.SCR
echo MOV [7C20],CX >> CP3204.SCR
echo MOV AL,[7C10] >> CP3204.SCR
echo MUL WORD PTR [7C16] >> CP3204.SCR
echo ADD AX,[7C1C] >> CP3204.SCR
echo ADC DX,[7C1E] >> CP3204.SCR
echo ADD AX,[7C0E] >> CP3204.SCR
echo ADC DX,0 >> CP3204.SCR
echo MOV [7C50],AX >> CP3204.SCR
echo MOV [7C52],DX >> CP3204.SCR
echo MOV [7C49],AX >> CP3204.SCR
echo MOV [7C4B],DX >> CP3204.SCR
echo MOV AX,20 >> CP3204.SCR
echo MUL WORD PTR [7C11] >> CP3204.SCR
echo MOV BX,[7C0B] >> CP3204.SCR
echo ADD AX,BX >> CP3204.SCR
echo DEC AX >> CP3204.SCR
echo DIV BX >> CP3204.SCR
echo ADD [7C49],AX >> CP3204.SCR
echo ADC WORD PTR [7C4B],0 >> CP3204.SCR
echo MOV BX,500 >> CP3204.SCR
echo MOV DX,[7C52] >> CP3204.SCR
echo MOV AX,[7C50] >> CP3204.SCR
echo CALL 560 >> CP3204.SCR
echo JC 4ED >> CP3204.SCR
echo MOV AL,1 >> CP3204.SCR
echo CALL 581 >> CP3204.SCR
echo JC 4ED >> CP3204.SCR
echo MOV DI,BX >> CP3204.SCR
echo MOV CX,B >> CP3204.SCR
echo MOV SI,7DE6 >> CP3204.SCR
echo REPZ >> CP3204.SCR
echo CMPSB >> CP3204.SCR
echo JNZ 4ED >> CP3204.SCR
echo LEA DI,[BX+20] >> CP3204.SCR
echo MOV CX,B >> CP3204.SCR
echo REPZ >> CP3204.SCR
echo CMPSB >> CP3204.SCR
echo JZ 505 >> CP3204.SCR
echo MOV SI,7D9E >> CP3204.SCR
echo CALL 552 >> CP3204.SCR
echo XOR AX,AX >> CP3204.SCR
echo INT 16 >> CP3204.SCR
echo POP SI >> CP3204.SCR
echo POP DS >> CP3204.SCR
echo POP [SI] >> CP3204.SCR
echo POP [SI+2] >> CP3204.SCR
echo INT 19 >> CP3204.SCR
echo POP AX >> CP3204.SCR
echo POP AX >> CP3204.SCR
echo POP AX >> CP3204.SCR
echo JMP 4ED >> CP3204.SCR
echo MOV AX,[BX+1A] >> CP3204.SCR
echo DEC AX >> CP3204.SCR
echo DEC AX >> CP3204.SCR
echo MOV BL,[7C0D] >> CP3204.SCR
echo XOR BH,BH >> CP3204.SCR
echo MUL BX >> CP3204.SCR
echo ADD AX,[7C49] >> CP3204.SCR
echo ADC DX,[7C4B] >> CP3204.SCR
echo MOV BX,700 >> CP3204.SCR
echo MOV CX,3 >> CP3204.SCR
echo PUSH AX >> CP3204.SCR
echo PUSH DX >> CP3204.SCR
echo PUSH CX >> CP3204.SCR
echo CALL 560 >> CP3204.SCR
echo JC 500 >> CP3204.SCR
echo MOV AL,1 >> CP3204.SCR
echo CALL 581 >> CP3204.SCR
echo POP CX >> CP3204.SCR
echo POP DX >> CP3204.SCR
echo POP AX >> CP3204.SCR
echo JC 4ED >> CP3204.SCR
echo ADD AX,1 >> CP3204.SCR
echo ADC DX,0 >> CP3204.SCR
echo ADD BX,[7C0B] >> CP3204.SCR
echo LOOP 520 >> CP3204.SCR
echo MOV CH,[7C15] >> CP3204.SCR
echo MOV DL,[7C24] >> CP3204.SCR
echo MOV BX,[7C49] >> CP3204.SCR
echo MOV AX,[7C4B] >> CP3204.SCR
echo JMP 70:0 >> CP3204.SCR
echo LODSB >> CP3204.SCR
echo OR AL,AL >> CP3204.SCR
echo JZ 580 >> CP3204.SCR
echo MOV AH,E >> CP3204.SCR
echo MOV BX,7 >> CP3204.SCR
echo INT 10 >> CP3204.SCR
echo JMP 552 >> CP3204.SCR
echo CMP DX,[7C18] >> CP3204.SCR
echo JNC 57F >> CP3204.SCR
echo DIV WORD PTR [7C18] >> CP3204.SCR
echo INC DL >> CP3204.SCR
echo MOV [7C4F],DL >> CP3204.SCR
echo XOR DX,DX >> CP3204.SCR
echo DIV WORD PTR [7C1A] >> CP3204.SCR
echo MOV [7C25],DL >> CP3204.SCR
echo MOV [7C4D],AX >> CP3204.SCR
echo CLC >> CP3204.SCR
echo RET >> CP3204.SCR
echo STC >> CP3204.SCR
echo RET >> CP3204.SCR
echo MOV AH,2 >> CP3204.SCR
echo MOV DX,[7C4D] >> CP3204.SCR
echo MOV CL,6 >> CP3204.SCR
echo SHL DH,CL >> CP3204.SCR
echo OR DH,[7C4F] >> CP3204.SCR
echo MOV CX,DX >> CP3204.SCR
echo XCHG CH,CL >> CP3204.SCR
echo MOV DL,[7C24] >> CP3204.SCR
echo MOV DH,[7C25] >> CP3204.SCR
echo INT 13 >> CP3204.SCR
echo RET >> CP3204.SCR
echo >> CP3204.SCR
rem Use CTRL-H (BACKSPACE) character for ^H shown on the line above.
echo E 59E D A "Non-system disk or disk error" >> CP3204.SCR
echo E 5BD D A "Replace and press any key when ready" >> CP3204.SCR
echo E 5E3 D A 0 >> CP3204.SCR
rem Define DOS system file names (11-characters each)
echo E 5E6 "IO SYS" >> CP3204.SCR
echo E 5F1 "MSDOS SYS" >> CP3204.SCR
:PUTSIGN
rem The two bytes below MUST be as shown in order for the BIOS the recognize
rem the fixed disk. The bytes represent that the boot sector is valid.
rem Write signature to indicate valid boot sector.
echo E 5FE 55 AA >> CP3204.SCR
echo creation of DOS boot sector complete . . .
rem Write FAT ID bytes to 1st FAT sector.
echo E 600 F8 FF FF FF >> CP3204.SCR
rem ═══════════════════════════════════════════════════════════════════════════════
rem Shown on the following pages is the partition table for each logical drive.
rem The partition table for each logical drive fits nicely on one page. There
rem are four (4) partition tables for the 1st fixed disk and five (5) partition
rem tables for the 2nd fixed disk. The entire 2nd fixed disk is setup as an
rem EXTENDed partition and so requires a Master Partition Table. An explanation
rem is contained on the page where the Master Partition Table for the 2nd fixed
rem disk is defined.
rem By studying the partition tables, you should be able to create a DOC file
rem to partition your particular fixed disk. Use this DOC file as a guide and
rem work carefully. Remember to backup your fixed disk before using the program
rem to partition your fixed disk.
rem Shown below for reference is the list of valid system ID codes which can
rem be entered into the partition table. The SYSTEM codes were determined using
rem the Norton Utilites v5.0 DISKEDIT program to look at the fixed disk partition
rem tables.
rem V A L I D S Y S T E M I D C O D E
rem ═══════════════════════════════════════════════════════════════════════════════
rem 00 ── indicates an unused partition
rem 01 ── DOS-12
rem 02 ── XENIX
rem 04 ── DOS-16
rem 05 ── EXTEND
rem 06 ── BIGDOS
rem 07 ── HPFS
rem 08 ── Split
rem 50 ── DM
rem 56 ── GB
rem 61 ── NOVELL
rem 63 ── PCIX
rem 64 ── CP/M
rem 75 ── Speed
rem DB ── BBT
rem FF ── 386/ix
rem NOTE: The above values are in hex.
rem
:DISK1
rem If 2nd fixed disk option was chosen,
rem jump to partition information for 2nd fixed disk.
if [%1]==[/2] goto DISK2
rem F I X E D D I S K D R I V E P A R T I T I O N T A B L E
rem ═══════════════════════════════════════════════════════════════════════════════
rem FDISK1 VOL1 ── logical drive C:
rem ┌──────┬────┬────────────────────┬────────────────────┬───────────┬───────────┐
rem │ │ │ Starting Location │ Ending Location │ Relative │ Number of │
rem │System│Boot│Side Cylinder Sector│Side Cylinder Sector│ Sectors │ Sectors │
rem ├──────┼────┼────────────────────┼────────────────────┼───────────┼───────────┤
rem │BIGDOS│ Yes│ 0 0 2 │ 14 135 51 │ 1 │ 104039 │
rem │EXTEND│ No │ 0 136 1 │ 14 543 51 │ 104040 │ 312120 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem └──────┴────┴────────────────────┴────────────────────┴───────────┴───────────┘
rem Listed below is the RELATIVE location of each byte in the partition table.
rem The 16-byte list is repeated for each line in the partition table. A
rem maximum of 4 partitions may be defined. The partition table begins at
rem sector offset 01BE.
rem 0000 00 ; partition status (active [80] or non-active [00])
rem 0001 00 ; starting side
rem 0002 00 ; starting sector (lower 6-bits, upper 2-bits for cylinder)
rem 0003 00 ; starting cylinder (lower byte)
rem 0004 00 ; system (see information on previous page for valid codes)
rem 0005 00 ; ending side
rem 0006 00 ; ending sector (lower 6-bits, upper 2-bits for cylinder)
rem 0007 00 ; ending cylinder (lower byte)
rem 0008 00 00 00 00 ; relative sectors
rem 000C 00 00 00 00 ; number of sectors
rem Finally, the actual partition table data.
rem Remember, data order is low-byte, then high-byte.
echo E 3BE 80 >> CP3204.SCR
echo E 3BF 00 >> CP3204.SCR
echo E 3C0 02 >> CP3204.SCR
echo E 3C1 00 >> CP3204.SCR
echo E 3C2 06 >> CP3204.SCR
echo E 3C3 0E >> CP3204.SCR
echo E 3C4 33 >> CP3204.SCR
echo E 3C5 87 >> CP3204.SCR
echo E 3C6 01 00 00 00 >> CP3204.SCR
echo E 3CA 67 96 01 00 >> CP3204.SCR
echo E 3CE 00 >> CP3204.SCR
echo E 3CF 00 >> CP3204.SCR
echo E 3D0 01 >> CP3204.SCR
echo E 3D1 88 >> CP3204.SCR
echo E 3D2 05 >> CP3204.SCR
echo E 3D3 0E >> CP3204.SCR
echo E 3D4 B3 >> CP3204.SCR
echo E 3D5 1F >> CP3204.SCR
echo E 3D6 68 96 01 00 >> CP3204.SCR
echo E 3DA 38 C3 04 00 >> CP3204.SCR
rem Update volume label in BIOS Parameter Block.
echo E 435 "1" >> CP3204.SCR
rem If REM option was chosen, don't execute partition program. Otherwise,
rem go write partition sector, boot sector, and 1st FAT sector.
echo %4 G=100 138 >> CP3204.SCR
rem Clear the Partition Boot Program and DOS Boot Program.
rem They are NOT needed on logical drives in EXTENDed partitions.
echo F 200 2E0 0 >> CP3204.SCR
echo F 43E 5FD 0 >> CP3204.SCR
echo creation of partition table for 1st logical drive complete . . .
rem
rem F I X E D D I S K D R I V E P A R T I T I O N T A B L E
rem ═══════════════════════════════════════════════════════════════════════════════
rem FDISK1 VOL2 ── logical drive D:
rem ┌──────┬────┬────────────────────┬────────────────────┬───────────┬───────────┐
rem │ │ │ Starting Location │ Ending Location │ Relative │ Number of │
rem │System│Boot│Side Cylinder Sector│Side Cylinder Sector│ Sectors │ Sectors │
rem ├──────┼────┼────────────────────┼────────────────────┼───────────┼───────────┤
rem │BIGDOS│ No │ 0 136 2 │ 14 271 51 │ 1 │ 104039 │
rem │EXTEND│ No │ 0 272 1 │ 14 407 51 │ 104040 │ 104040 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem └──────┴────┴────────────────────┴────────────────────┴───────────┴───────────┘
rem Listed below is the RELATIVE location of each byte in the partition table.
rem The 16-byte list is repeated for each line in the partition table. A
rem maximum of 4 partitions may be defined. The partition table begins at
rem sector offset 01BE.
rem 0000 00 ; partition status (active [80] or non-active [00])
rem 0001 00 ; starting side
rem 0002 00 ; starting sector (lower 6-bits, upper 2-bits for cylinder)
rem 0003 00 ; starting cylinder (lower byte)
rem 0004 00 ; system (see information on previous page for valid codes)
rem 0005 00 ; ending side
rem 0006 00 ; ending sector (lower 6-bits, upper 2-bits for cylinder)
rem 0007 00 ; ending cylinder (lower byte)
rem 0008 00 00 00 00 ; relative sectors
rem 000C 00 00 00 00 ; number of sectors
rem Finally, the actual partition table data.
rem Remember, data order is low-byte, then high-byte.
echo E 3BE 00 >> CP3204.SCR
echo E 3BF 00 >> CP3204.SCR
echo E 3C0 02 >> CP3204.SCR
echo E 3C1 88 >> CP3204.SCR
echo E 3C2 06 >> CP3204.SCR
echo E 3C3 0E >> CP3204.SCR
echo E 3C4 73 >> CP3204.SCR
echo E 3C5 0F >> CP3204.SCR
echo E 3C6 01 00 00 00 >> CP3204.SCR
echo E 3CA 67 96 01 00 >> CP3204.SCR
echo E 3CE 00 >> CP3204.SCR
echo E 3CF 00 >> CP3204.SCR
echo E 3D0 41 >> CP3204.SCR
echo E 3D1 10 >> CP3204.SCR
echo E 3D2 05 >> CP3204.SCR
echo E 3D3 0E >> CP3204.SCR
echo E 3D4 73 >> CP3204.SCR
echo E 3D5 97 >> CP3204.SCR
echo E 3D6 68 96 01 00 >> CP3204.SCR
echo E 3DA 68 96 01 00 >> CP3204.SCR
rem Update partition program code to write data on correct cylinder.
echo E 11D 01 88 >> CP3204.SCR
rem Update volume label in BIOS Parameter Block.
echo E 435 "2" >> CP3204.SCR
rem If REM option was chosen, don't execute partition program. Otherwise,
rem go write partition sector, boot sector, and 1st FAT sector.
echo %4 G=100 138 >> CP3204.SCR
echo creation of partition table for 2nd logical drive complete . . .
rem
rem F I X E D D I S K D R I V E P A R T I T I O N T A B L E
rem ═══════════════════════════════════════════════════════════════════════════════
rem FDISK1 VOL3 ── logical drive E:
rem ┌──────┬────┬────────────────────┬────────────────────┬───────────┬───────────┐
rem │ │ │ Starting Location │ Ending Location │ Relative │ Number of │
rem │System│Boot│Side Cylinder Sector│Side Cylinder Sector│ Sectors │ Sectors │
rem ├──────┼────┼────────────────────┼────────────────────┼───────────┼───────────┤
rem │BIGDOS│ Yes│ 0 272 2 │ 14 407 51 │ 1 │ 104039 │
rem │EXTEND│ No │ 0 408 1 │ 14 543 51 │ 208080 │ 104040 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem └──────┴────┴────────────────────┴────────────────────┴───────────┴───────────┘
rem Listed below is the RELATIVE location of each byte in the partition table.
rem The 16-byte list is repeated for each line in the partition table. A
rem maximum of 4 partitions may be defined. The partition table begins at
rem sector offset 01BE.
rem 0000 00 ; partition status (active [80] or non-active [00])
rem 0001 00 ; starting side
rem 0002 00 ; starting sector (lower 6-bits, upper 2-bits for cylinder)
rem 0003 00 ; starting cylinder (lower byte)
rem 0004 00 ; system (see information on previous page for valid codes)
rem 0005 00 ; ending side
rem 0006 00 ; ending sector (lower 6-bits, upper 2-bits for cylinder)
rem 0007 00 ; ending cylinder (lower byte)
rem 0008 00 00 00 00 ; relative sectors
rem 000C 00 00 00 00 ; number of sectors
rem Finally, the actual partition table data.
rem Remember, data order is low-byte, then high-byte.
echo E 3BE 00 >> CP3204.SCR
echo E 3BF 00 >> CP3204.SCR
echo E 3C0 42 >> CP3204.SCR
echo E 3C1 10 >> CP3204.SCR
echo E 3C2 06 >> CP3204.SCR
echo E 3C3 0E >> CP3204.SCR
echo E 3C4 73 >> CP3204.SCR
echo E 3C5 97 >> CP3204.SCR
echo E 3C6 01 00 00 00 >> CP3204.SCR
echo E 3CA 67 96 01 00 >> CP3204.SCR
echo E 3CE 00 >> CP3204.SCR
echo E 3CF 00 >> CP3204.SCR
echo E 3D0 41 >> CP3204.SCR
echo E 3D1 98 >> CP3204.SCR
echo E 3D2 05 >> CP3204.SCR
echo E 3D3 0E >> CP3204.SCR
echo E 3D4 B3 >> CP3204.SCR
echo E 3D5 1F >> CP3204.SCR
echo E 3D6 D0 2C 03 00 >> CP3204.SCR
echo E 3DA 68 96 01 00 >> CP3204.SCR
rem Update partition program code to write data on correct cylinder.
echo E 11D 41 10 >> CP3204.SCR
rem Update volume label in BIOS Parameter Block.
echo E 435 "3" >> CP3204.SCR
rem If REM option was chosen, don't execute partition program. Otherwise,
rem go write partition sector, boot sector, and 1st FAT sector.
echo %4 G=100 138 >> CP3204.SCR
echo creation of partition table for 3rd logical drive complete . . .
rem
rem F I X E D D I S K D R I V E P A R T I T I O N T A B L E
rem ═══════════════════════════════════════════════════════════════════════════════
rem FDISK1 VOL4 ── logical drive F:
rem ┌──────┬────┬────────────────────┬────────────────────┬───────────┬───────────┐
rem │ │ │ Starting Location │ Ending Location │ Relative │ Number of │
rem │System│Boot│Side Cylinder Sector│Side Cylinder Sector│ Sectors │ Sectors │
rem ├──────┼────┼────────────────────┼────────────────────┼───────────┼───────────┤
rem │BIGDOS│ No │ 0 408 2 │ 14 543 51 │ 1 │ 104039 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem └──────┴────┴────────────────────┴────────────────────┴───────────┴───────────┘
rem Listed below is the RELATIVE location of each byte in the partition table.
rem The 16-byte list is repeated for each line in the partition table. A
rem maximum of 4 partitions may be defined. The partition table begins at
rem sector offset 01BE.
rem 0000 00 ; partition status (active [80] or non-active [00])
rem 0001 00 ; starting side
rem 0002 00 ; starting sector (lower 6-bits, upper 2-bits for cylinder)
rem 0003 00 ; starting cylinder (lower byte)
rem 0004 00 ; system (see information on previous page for valid codes)
rem 0005 00 ; ending side
rem 0006 00 ; ending sector (lower 6-bits, upper 2-bits for cylinder)
rem 0007 00 ; ending cylinder (lower byte)
rem 0008 00 00 00 00 ; relative sectors
rem 000C 00 00 00 00 ; number of sectors
rem Finally, the actual partition table data.
rem Remember, data order is low-byte, then high-byte.
echo E 3BE 00 >> CP3204.SCR
echo E 3BF 00 >> CP3204.SCR
echo E 3C0 42 >> CP3204.SCR
echo E 3C1 98 >> CP3204.SCR
echo E 3C2 06 >> CP3204.SCR
echo E 3C3 0E >> CP3204.SCR
echo E 3C4 B3 >> CP3204.SCR
echo E 3C5 1F >> CP3204.SCR
echo E 3C6 01 00 00 00 >> CP3204.SCR
echo E 3CA 67 96 01 00 >> CP3204.SCR
rem No EXTENDed partition data in partition table of last logical drive.
echo F 3CE 3DD 0 >> CP3204.SCR
rem Update partition program code to write data on correct cylinder.
echo E 11D 41 98 >> CP3204.SCR
rem Update volume label in BIOS Parameter Block.
echo E 435 "4" >> CP3204.SCR
rem If REM option was chosen, don't execute partition program. Otherwise,
rem go write partition sector, boot sector, and 1st FAT sector.
echo %4 G=100 >> CP3204.SCR
rem Finally, end of DEBUG script for 1st fixed disk.
echo Q >> CP3204.SCR
echo creation of partition table for 4th logical drive complete . . .
goto RUN
rem
:DISK2
rem F I X E D D I S K D R I V E P A R T I T I O N T A B L E
rem ═══════════════════════════════════════════════════════════════════════════════
rem Fixed Disk 2 ── Master Partition Table
rem ┌──────┬────┬────────────────────┬────────────────────┬───────────┬───────────┐
rem │ │ │ Starting Location │ Ending Location │ Relative │ Number of │
rem │System│Boot│Side Cylinder Sector│Side Cylinder Sector│ Sectors │ Sectors │
rem ├──────┼────┼────────────────────┼────────────────────┼───────────┼───────────┤
rem │EXTEND│ No │ 0 0 2 │ 14 543 51 │ 1 │ 416159 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem └──────┴────┴────────────────────┴────────────────────┴───────────┴───────────┘
rem Listed below is the RELATIVE location of each byte in the partition table.
rem The 16-byte list is repeated for each line in the partition table. A
rem maximum of 4 partitions may be defined. The partition table begins at
rem sector offset 01BE.
rem 0000 00 ; partition status (active [80] or non-active [00])
rem 0001 00 ; starting side
rem 0002 00 ; starting sector (lower 6-bits, upper 2-bits for cylinder)
rem 0003 00 ; starting cylinder (lower byte)
rem 0004 00 ; system (see information on previous page for valid codes)
rem 0005 00 ; ending side
rem 0006 00 ; ending sector (lower 6-bits, upper 2-bits for cylinder)
rem 0007 00 ; ending cylinder (lower byte)
rem 0008 00 00 00 00 ; relative sectors
rem 000C 00 00 00 00 ; number of sectors
rem Finally, the actual partition table data.
rem Remember, data order is low-byte, then high-byte.
echo E 3BE 00 >> CP3204.SCR
echo E 3BF 00 >> CP3204.SCR
echo E 3C0 02 >> CP3204.SCR
echo E 3C1 00 >> CP3204.SCR
echo E 3C2 05 >> CP3204.SCR
echo E 3C3 0E >> CP3204.SCR
echo E 3C4 B3 >> CP3204.SCR
echo E 3C5 1F >> CP3204.SCR
echo E 3C6 01 00 00 00 >> CP3204.SCR
echo E 3CA 9F 59 06 00 >> CP3204.SCR
echo creation of master partition table complete . . .
rem A few words about partitioning the 2nd fixed disk are in order. When the
rem entire 2nd fixed disk is setup as an EXTENDed partition, the first sector
rem contains the master partition table. This is shown above. Since there
rem is an additional logical drive on the disk, an additional partition table
rem is required for the first logical drive on the disk. In order to conserve
rem disk space and maintain the same logical structure as the 1st fixed disk,
rem the additional partition table is placed in the 2nd sector on the disk.
rem
rem The second sector then contains the partition table for the first logical
rem drive AND the BIOS Parameter Block. This is possible because the DOS boot
rem program is not required. The starting location entered in the partition
rem table for first logical disk is the same as the starting location entered
rem in the master partition table. Study the master partition table above and
rem the partition table for the first logical drive on the next page. Make
rem sure you understand what is happening before you try this with your
rem particular system.
rem
rem F I X E D D I S K D R I V E P A R T I T I O N T A B L E
rem ═══════════════════════════════════════════════════════════════════════════════
rem FDISK2 VOL1 ── logical drive G:
rem ┌──────┬────┬────────────────────┬────────────────────┬───────────┬───────────┐
rem │ │ │ Starting Location │ Ending Location │ Relative │ Number of │
rem │System│Boot│Side Cylinder Sector│Side Cylinder Sector│ Sectors │ Sectors │
rem ├──────┼────┼────────────────────┼────────────────────┼───────────┼───────────┤
rem │BIGDOS│ No │ 0 0 2 │ 14 135 51 │ 1 │ 104039 │
rem │EXTEND│ No │ 0 136 1 │ 14 271 51 │ 104040 │ 104040 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem └──────┴────┴────────────────────┴────────────────────┴───────────┴───────────┘
rem Listed below is the RELATIVE location of each byte in the partition table.
rem The 16-byte list is repeated for each line in the partition table. A
rem maximum of 4 partitions may be defined. The partition table begins at
rem sector offset 01BE.
rem 0000 00 ; partition status (active [80] or non-active [00])
rem 0001 00 ; starting side
rem 0002 00 ; starting sector (lower 6-bits, upper 2-bits for cylinder)
rem 0003 00 ; starting cylinder (lower byte)
rem 0004 00 ; system (see information on previous page for valid codes)
rem 0005 00 ; ending side
rem 0006 00 ; ending sector (lower 6-bits, upper 2-bits for cylinder)
rem 0007 00 ; ending cylinder (lower byte)
rem 0008 00 00 00 00 ; relative sectors
rem 000C 00 00 00 00 ; number of sectors
rem Finally, the actual partition table data.
rem Remember, data order is low-byte, then high-byte.
echo E 5BE 00 >> CP3204.SCR
echo E 5BF 00 >> CP3204.SCR
echo E 5C0 02 >> CP3204.SCR
echo E 5C1 00 >> CP3204.SCR
echo E 5C2 06 >> CP3204.SCR
echo E 5C3 0E >> CP3204.SCR
echo E 5C4 33 >> CP3204.SCR
echo E 5C5 87 >> CP3204.SCR
echo E 5C6 01 00 00 00 >> CP3204.SCR
echo E 5CA 67 96 01 00 >> CP3204.SCR
echo E 5CE 00 >> CP3204.SCR
echo E 5CF 00 >> CP3204.SCR
echo E 5D0 01 >> CP3204.SCR
echo E 5D1 88 >> CP3204.SCR
echo E 5D2 05 >> CP3204.SCR
echo E 5D3 0E >> CP3204.SCR
echo E 5D4 73 >> CP3204.SCR
echo E 5D5 0F >> CP3204.SCR
echo E 5D6 68 96 01 00 >> CP3204.SCR
echo E 5DA 68 96 01 00 >> CP3204.SCR
rem Update volume label in BIOS Parameter Block.
echo E 435 "1" >> CP3204.SCR
rem If REM option was chosen, don't execute partition program. Otherwise,
rem go write partition sector, boot sector, and 1st FAT sector.
echo %4 G=100 138 >> CP3204.SCR
rem Clear partition table in boot sector.
echo F 5BE 5FD 0 >> CP3204.SCR
echo creation of partition table for 1st logical drive complete . . .
rem
rem F I X E D D I S K D R I V E P A R T I T I O N T A B L E
rem ═══════════════════════════════════════════════════════════════════════════════
rem FDISK2 VOL2 ── logical drive H:
rem ┌──────┬────┬────────────────────┬────────────────────┬───────────┬───────────┐
rem │ │ │ Starting Location │ Ending Location │ Relative │ Number of │
rem │System│Boot│Side Cylinder Sector│Side Cylinder Sector│ Sectors │ Sectors │
rem ├──────┼────┼────────────────────┼────────────────────┼───────────┼───────────┤
rem │BIGDOS│ No │ 0 136 2 │ 14 271 51 │ 1 │ 104039 │
rem │EXTEND│ No │ 0 272 1 │ 14 407 51 │ 208080 │ 104040 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem └──────┴────┴────────────────────┴────────────────────┴───────────┴───────────┘
rem Listed below is the RELATIVE location of each byte in the partition table.
rem The 16-byte list is repeated for each line in the partition table. A
rem maximum of 4 partitions may be defined. The partition table begins at
rem sector offset 01BE.
rem 0000 00 ; partition status (active [80] or non-active [00])
rem 0001 00 ; starting side
rem 0002 00 ; starting sector (lower 6-bits, upper 2-bits for cylinder)
rem 0003 00 ; starting cylinder (lower byte)
rem 0004 00 ; system (see information on previous page for valid codes)
rem 0005 00 ; ending side
rem 0006 00 ; ending sector (lower 6-bits, upper 2-bits for cylinder)
rem 0007 00 ; ending cylinder (lower byte)
rem 0008 00 00 00 00 ; relative sectors
rem 000C 00 00 00 00 ; number of sectors
rem Finally, the actual partition table data.
rem Remember, data order is low-byte, then high-byte.
echo E 3BE 00 >> CP3204.SCR
echo E 3BF 00 >> CP3204.SCR
echo E 3C0 02 >> CP3204.SCR
echo E 3C1 88 >> CP3204.SCR
echo E 3C2 06 >> CP3204.SCR
echo E 3C3 0E >> CP3204.SCR
echo E 3C4 73 >> CP3204.SCR
echo E 3C5 0F >> CP3204.SCR
echo E 3C6 01 00 00 00 >> CP3204.SCR
echo E 3CA 67 96 01 00 >> CP3204.SCR
echo E 3CE 00 >> CP3204.SCR
echo E 3CF 00 >> CP3204.SCR
echo E 3D0 41 >> CP3204.SCR
echo E 3D1 10 >> CP3204.SCR
echo E 3D2 05 >> CP3204.SCR
echo E 3D3 0E >> CP3204.SCR
echo E 3D4 73 >> CP3204.SCR
echo E 3D5 97 >> CP3204.SCR
echo E 3D6 D0 2C 03 00 >> CP3204.SCR
echo E 3DA 68 96 01 00 >> CP3204.SCR
rem Update partition program code to write data on correct cylinder.
echo E 11D 01 88 >> CP3204.SCR
rem Update volume label in BIOS Parameter Block.
echo E 435 "2" >> CP3204.SCR
rem If REM option was chosen, don't execute partition program. Otherwise,
rem go write partition sector, boot sector, and 1st FAT sector.
echo %4 G=100 138 >> CP3204.SCR
echo creation of partition table for 2nd logical drive complete . . .
rem
rem F I X E D D I S K D R I V E P A R T I T I O N T A B L E
rem ═══════════════════════════════════════════════════════════════════════════════
rem FDISK2 VOL3 ── logical drive I:
rem ┌──────┬────┬────────────────────┬────────────────────┬───────────┬───────────┐
rem │ │ │ Starting Location │ Ending Location │ Relative │ Number of │
rem │System│Boot│Side Cylinder Sector│Side Cylinder Sector│ Sectors │ Sectors │
rem ├──────┼────┼────────────────────┼────────────────────┼───────────┼───────────┤
rem │BIGDOS│ Yes│ 0 272 2 │ 14 407 51 │ 1 │ 104039 │
rem │EXTEND│ No │ 0 408 1 │ 14 543 51 │ 312120 │ 104040 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem └──────┴────┴────────────────────┴────────────────────┴───────────┴───────────┘
rem Listed below is the RELATIVE location of each byte in the partition table.
rem The 16-byte list is repeated for each line in the partition table. A
rem maximum of 4 partitions may be defined. The partition table begins at
rem sector offset 01BE.
rem 0000 00 ; partition status (active [80] or non-active [00])
rem 0001 00 ; starting side
rem 0002 00 ; starting sector (lower 6-bits, upper 2-bits for cylinder)
rem 0003 00 ; starting cylinder (lower byte)
rem 0004 00 ; system (see information on previous page for valid codes)
rem 0005 00 ; ending side
rem 0006 00 ; ending sector (lower 6-bits, upper 2-bits for cylinder)
rem 0007 00 ; ending cylinder (lower byte)
rem 0008 00 00 00 00 ; relative sectors
rem 000C 00 00 00 00 ; number of sectors
rem Finally, the actual partition table data.
rem Remember, data order is low-byte, then high-byte.
echo E 3BE 00 >> CP3204.SCR
echo E 3BF 00 >> CP3204.SCR
echo E 3C0 42 >> CP3204.SCR
echo E 3C1 10 >> CP3204.SCR
echo E 3C2 06 >> CP3204.SCR
echo E 3C3 0E >> CP3204.SCR
echo E 3C4 73 >> CP3204.SCR
echo E 3C5 97 >> CP3204.SCR
echo E 3C6 01 00 00 00 >> CP3204.SCR
echo E 3CA 67 96 01 00 >> CP3204.SCR
echo E 3CE 00 >> CP3204.SCR
echo E 3CF 00 >> CP3204.SCR
echo E 3D0 41 >> CP3204.SCR
echo E 3D1 98 >> CP3204.SCR
echo E 3D2 05 >> CP3204.SCR
echo E 3D3 0E >> CP3204.SCR
echo E 3D4 B3 >> CP3204.SCR
echo E 3D5 1F >> CP3204.SCR
echo E 3D6 38 C3 04 00 >> CP3204.SCR
echo E 3DA 68 96 01 00 >> CP3204.SCR
rem Update partition program code to write data on correct cylinder.
echo E 11D 41 10 >> CP3204.SCR
rem Update volume label in BIOS Parameter Block.
echo E 435 "3" >> CP3204.SCR
rem If REM option was chosen, don't execute partition program. Otherwise,
rem go write partition sector, boot sector, and 1st FAT sector.
echo %4 G=100 138 >> CP3204.SCR
echo creation of partition table for 3rd logical drive complete . . .
rem
rem F I X E D D I S K D R I V E P A R T I T I O N T A B L E
rem ═══════════════════════════════════════════════════════════════════════════════
rem FDISK2 VOL4 ── logical drive J:
rem ┌──────┬────┬────────────────────┬────────────────────┬───────────┬───────────┐
rem │ │ │ Starting Location │ Ending Location │ Relative │ Number of │
rem │System│Boot│Side Cylinder Sector│Side Cylinder Sector│ Sectors │ Sectors │
rem ├──────┼────┼────────────────────┼────────────────────┼───────────┼───────────┤
rem │BIGDOS│ No │ 0 408 2 │ 14 543 51 │ 1 │ 104039 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem │unused│ No │ 0 0 0 │ 0 0 0 │ 0 │ 0 │
rem └──────┴────┴────────────────────┴────────────────────┴───────────┴───────────┘
rem Listed below is the RELATIVE location of each byte in the partition table.
rem The 16-byte list is repeated for each line in the partition table. A
rem maximum of 4 partitions may be defined. The partition table begins at
rem sector offset 01BE.
rem 0000 00 ; partition status (active [80] or non-active [00])
rem 0001 00 ; starting side
rem 0002 00 ; starting sector (lower 6-bits, upper 2-bits for cylinder)
rem 0003 00 ; starting cylinder (lower byte)
rem 0004 00 ; system (see information on previous page for valid codes)
rem 0005 00 ; ending side
rem 0006 00 ; ending sector (lower 6-bits, upper 2-bits for cylinder)
rem 0007 00 ; ending cylinder (lower byte)
rem 0008 00 00 00 00 ; relative sectors
rem 000C 00 00 00 00 ; number of sectors
rem Finally, the actual partition table data.
rem Remember, data order is low-byte, then high-byte.
echo E 3BE 00 >> CP3204.SCR
echo E 3BF 00 >> CP3204.SCR
echo E 3C0 42 >> CP3204.SCR
echo E 3C1 98 >> CP3204.SCR
echo E 3C2 06 >> CP3204.SCR
echo E 3C3 0E >> CP3204.SCR
echo E 3C4 B3 >> CP3204.SCR
echo E 3C5 1F >> CP3204.SCR
echo E 3C6 01 00 00 00 >> CP3204.SCR
echo E 3CA 67 96 01 00 >> CP3204.SCR
rem No EXTENDed partition data in partition table of last logical drive.
echo F 3CE 3DD 0 >> CP3204.SCR
rem Update partition program code to write data on correct cylinder.
echo E 11D 41 98 >> CP3204.SCR
rem Update volume label in BIOS Parameter Block.
echo E 435 "4" >> CP3204.SCR
rem If REM option was chosen, don't execute partition program. Otherwise,
rem go write partition sector, boot sector, and 1st FAT sector.
echo %4 G=100 >> CP3204.SCR
rem Finally, end of DEBUG script for 2nd fixed disk.
echo Q >> CP3204.SCR
echo creation of partition table for 4th logical drive complete . . .
rem
:RUN
echo END - creation of CP3204.SCR
echo
goto @%OPTION%
:@PREPARE
if NOT EXIST prepare.bin goto ERR0
ren prepare.bin prepare.com
echo BEGIN: Fixed disk [%1] preparation . . .
%4 prepare %1 /P
echo
if ERRORLEVEL 1 goto ERR1
if ERRORLEVEL 0 goto @RESTORE
echo ERROR: Invalid ERRORLEVEL during fixed disk [%1] preparation.
goto EXIT
:@RESTORE
echo BEGIN: Fixed disk [%1] partitioning . . .
debug < CP3204.SCR > %OUTFILE%
echo
if ERRORLEVEL 128 goto ERR128
if ERRORLEVEL 2 goto ERR2
if ERRORLEVEL 0 goto OK
echo ERROR: Invalid ERRORLEVEL during fixed disk [%1] partitioning.
goto EXIT
:ERR0
echo ERROR: The file PREPARE.BIN is missing. Unable to prepare fixed disk [%1].
goto EXIT
:ERR1
echo ERROR: Unable to clear sectors during fixed disk [%1] preparation.
goto EXIT
:ERR2
echo ERROR: Unable to write partition sectors to fixed disk [%1].
goto EXIT
:ERR128
echo ERROR: Incorrect DOS version. This program required DOS 5.00 or higher.
goto EXIT
:@
echo ERROR: Environment variable OPTION not set. Unable to continue.
goto EXIT
:OK
echo Partition sectors sucessfully written to fixed disk.
echo
echo !!!!!!!!!!!!!!!!!!!! W A R N I N G !!!!!!!!!!!!!!!!!!!!
echo Do NOT use the FORMAT command to format fixed disk [%1].
echo All logical drives have been formatted by this program.
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo
echo Press CTRL-ALT-DEL to reboot . . .
:EXIT
set OPTION=
set OUTFILE=
if EXIST prepare.com ren prepare.com prepare.bin
if [%1]==[/1] if exist CP3204.SCR ren CP3204.SCR CP3204.1%2%4
if [%1]==[/2] if exist CP3204.SCR ren CP3204.SCR CP3204.2%2%4
echo